package org.jeecg.modules.mall.api.user.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.modules.appuser.service.ITbUserIntegralService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.Mapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

@Slf4j
@Api(tags = "app个人中心接口")
@RestController
@RequestMapping("/app/person/api")
public class PayController {

    @Autowired
    private ITbUserIntegralService tbUserIntegralService;

    @AutoLog(value = "支付回调")
    @ApiOperation("支付回调")
    @RequestMapping(value = "/returnPay")
    public Result<?> returnPay(String trade_order_id, BigDecimal total_fee, String transaction_id, String status, String appid) {
        log.info("测试returnPay");
        log.info("\n\n\n\n\n");
        log.info("--------------------------------------------------");
        log.info("支付回调trade_order_id----------------"+trade_order_id);
        log.info("total_fee---------------"+total_fee);
        log.info("transaction_id-----------"+transaction_id);
        log.info("status-------------"+status);
        log.info("appid-----------------"+appid);
        log.info("支付回调trade_order_id------------"+trade_order_id);
        log.info("--------------------------------------------------");
        log.info("\n\n\n\n\n");
        return tbUserIntegralService.returnPay(trade_order_id, total_fee, trade_order_id, status, appid);
    }
}
